<template>
  <el-select
    v-model="form[config.prop]"
    :placeholder="config.placeholder"
    style="width: 100%"
  >
    <el-option
      v-for="item in config.dict"
      :label="item[config.labelKey || 'label']"
      :value="item[config.valueKey || 'value']"
      :key="item[config.valueKey || 'value']"
    />
  </el-select>
</template>

<script setup lang="ts">
const props = defineProps({
  config: { type: Object, default: () => ({}) },
  form: { type: Object, required: true }
});
</script>

<style lang="less" scoped></style>
